import axios from "axios";

const baseUrl = 'http://localhost:3000';

const request = axios.create({
    baseUrl: baseUrl,
    timeout: 5000,

})

// 请求拦截器
request.interceptors.request.use((config) => {
    return config
},
    (err) => {
        return Promise.reject(err)
    }
)

//响应拦截器
request.interceptors.response.use((response) => {
    return response.data
},
    (err) => {
        return Promise.reject(err)
    }
)

export default request;